import { unref } from "vue"

export default function(callback, interval, options = {}) {
  const { immediate } = options
  if (immediate) callback()
  return setInterval(callback, unref(interval))
}